package com.example.order.utils;

import java.util.Random;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/6/12 20:03
 */
public class IdUtils {
    /**
     * 生产唯一主键
     * 格式：时间戳+随机数
     */
    public static synchronized String genUniqueId() {
        Random random = new Random();
        Integer num = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + String.valueOf(num);
    }
}
